<template>
    <cover-view>
        <!-- 底部导航栏 -->
        <nut-tabbar :v-model="active" 
        bottom safe-area-inset-bottom placeholder
        @tab-switch="tabSwitch"
        :unactive-color="tabBarConfig.unactiveColor" 
        :active-color="tabBarConfig.activeColor">
        <nut-tabbar-item v-for="(item, index) in tabBarItemList" :key="index" 
        :tab-title="item.title"
        :href="item.href"
        :value="item.value"
        >
            <template #icon="props">
                <img :src="props.active ? item.iconSelected : item.icon" alt="" />
            </template>
        </nut-tabbar-item>
        </nut-tabbar>
    </cover-view>
</template>
<script setup>
import { tabBarConfig, tabBarItemList } from './constants'
import Taro from '@tarojs/taro';

const active = 0;
const tabSwitch = (item, index) => {
    Taro.navigateTo({
        url: '/layouts/tabBar/mine'
    })
}
</script>